import { defineClientConfig } from 'vuepress/client'
import sourceEdit from '../src/components/sourceEdit.vue'
import preview from '../src/components/preview.vue'
import '../src/assets/index.scss'
import lastyear from 'last-year-components'
export default defineClientConfig({
  async enhance({ app, router, siteData }) {
    // app.component('sourceEdit', sourceEdit);
    // app.component('preview', preview);
    //挂载所有的案例组件
    const componentsArr = (import.meta as any).glob('../src/components/*.vue')
    for (const path in componentsArr) {
      const component = (await componentsArr[path]()).default
      app.component(component.__name, component)
    }



  },
  setup() {
    window && ((window as any).lastyear = lastyear)

  },
  rootComponents: [],
})